#pragma once
#include <vector>

using namespace std;

namespace yanghui
{
	class Solution {
	public:
		vector<vector<int>> yanghui(int numRows) {
			vector<vector<int>> r;
			for (int i = 0; i < numRows; i++)
			{
				r.push_back({1});
				int j = 1;
				for (; j < i; j++)
				{
					r[i].push_back(r[i - 1][j - 1] + r[i - 1][j]);
				}
				if (j < i + 1)
				{
					r[i].push_back(1);
				}
			}
			return r;
		}
	};
}